import request from '@/utils/request';

const prefix = '/role';

export const createRole = (data) => request.post(`${prefix}`, data);
export const getRoleList = (data) =>
  request.get(`${prefix}`, {
    params: data,
  });

export const deleteRole = (id) => request.delete(`${prefix}/${id}`);
export const getRoleDetail = (id) => request.get(`${prefix}/${id}`);
export const updateRole = (id, data) => request.put(`${prefix}/${id}`, data);
export const authorization = (id, data) =>
  request.post(`${prefix}/${id}/authorization`, data);
